package types

import (
	"strconv"

	"github.com/PicoChain/common"
)

type ChainStatus struct {
	blockNumber uint64
	blockHash   common.Hash
	txHash      common.Hash
	timestamp   uint64
}

// NewChainStatus return tx and block status in picoChain
func NewChainStatus(bNum uint64, bHash common.Hash, txhash common.Hash, t uint64) *ChainStatus {
	return &ChainStatus{
		blockNumber: bNum,
		blockHash:   bHash,
		txHash:      txhash,
		timestamp:   t,
	}
}

func (cs *ChainStatus) BlockNumber() string { return strconv.FormatUint(cs.blockNumber, 10) }
func (cs *ChainStatus) BlockHash() string   { return cs.blockHash.Hex() }
func (cs *ChainStatus) TxHash() string      { return cs.txHash.Hex() }
func (cs *ChainStatus) Timestamp() string   { return strconv.FormatUint(cs.timestamp, 10) }
